<template>
  <div>
    <h1>child2</h1>
    {{ toy }}
  </div>
</template>

<script setup lang="ts">
import { ref, onUnmounted } from "vue";
import emitter from "@/utils/emitter";
let toy = ref("");
emitter.on("send-toy", (value: any) => {
  toy.value = value;
});
onUnmounted(() => {
  emitter.off("send-toy");
});
</script>

<style scoped></style>
